package com.lvhx.springboot.base;

import com.lvhx.springboot.entity.User;
import com.lvhx.springboot.mapper.extend.UserExtendMapper;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 继承了聚合实体类
 * 里面用来注入mapper
 * 可以在里面写业务逻辑
 */
public class AccountAggregateUser extends AccountUser {
    @Autowired
    private UserExtendMapper userExtendMapper;

    public AccountAggregateUser(){};

    public AccountAggregateUser(User user, boolean lockYn, UserExtendMapper userExtendMapper){
        super(user,lockYn,userExtendMapper);
    };

    // 测试聚合里不能使用Autowired注入bean问题
    public void getInfo(){
        userExtendMapper.selectByPrimaryKey(1L);
    }
}
